package com.hdsx.jxcsxm.tjbb.controller;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Resource;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import com.hdsx.jxcsxm.tjbb.bean.Bkzh;
import com.hdsx.jxcsxm.tjbb.bean.Cgsjhlr;
import com.hdsx.jxcsxm.tjbb.bean.CgsjhlrMx;
import com.hdsx.jxcsxm.tjbb.bean.Excel_list;
import com.hdsx.jxcsxm.tjbb.server.SbzjCgsjhServer;
import com.hdsx.jxcsxm.utile.EasyUIPage;
import com.hdsx.jxcsxm.utile.ExcelReader;
import com.hdsx.jxcsxm.utile.ExcelReaderUtils;
import com.hdsx.jxcsxm.utile.JsonUtils;
import com.hdsx.jxcsxm.utile.MyUtil;
import com.hdsx.jxcsxm.utile.ResponseUtils;
import com.hdsx.jxcsxm.xtgl.bean.Xmjbxx;
import com.hdsx.webutil.struts.BaseActionSupport;
import com.opensymphony.xwork2.ModelDriven;

import oracle.net.aso.a;
import oracle.net.aso.l;

/**
 * Controller层
 * 省补资金车购税功能
 * @author 
 *
 */
@SuppressWarnings("serial")
@Scope("prototype")
@Controller
public class SbzjcgsController extends BaseActionSupport implements ModelDriven<Excel_list>{
	
	@Resource(name = "sbzjCgsjhServerImpl") 
		private SbzjCgsjhServer sbzjCgsjhServer; 
		private Cgsjhlr cgsjhlr = new Cgsjhlr();
		private CgsjhlrMx cgsjhlrMx = new CgsjhlrMx();
		private File fileupload;
		private String fileuploadFileName;
		private int page = 1;
		private int rows = 10;
		private Excel_list elist = new Excel_list();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");	 
		//DiskFileItemFactory diskfactory = new DiskFileItemFactory();//创建工厂类对象
		//ServletFileUpload fileUpload = new ServletFileUpload(diskfactory);//使用工厂创建解析器对象
		
		
	 
		/**
		 * @return the cgsjhlr
		 */
		public Cgsjhlr getCgsjhlr() {
			return cgsjhlr;
		}

		/**
		 * @param cgsjhlr the cgsjhlr to set
		 */
		public void setCgsjhlr(Cgsjhlr cgsjhlr) {
			this.cgsjhlr = cgsjhlr;
		}

		/**
		 * @return the cgsjhlrMx
		 */
		public CgsjhlrMx getCgsjhlrMx() {
			return cgsjhlrMx;
		}

		/**
		 * @param cgsjhlrMx the cgsjhlrMx to set
		 */
		public void setCgsjhlrMx(CgsjhlrMx cgsjhlrMx) {
			this.cgsjhlrMx = cgsjhlrMx;
		}

		/**
		 * @return the fileupload
		 */
		public File getFileupload() {
			return fileupload;
		}

		/**
		 * @param fileupload the fileupload to set
		 */
		public void setFileupload(File fileupload) {
			this.fileupload = fileupload;
		}

		/**
		 * @return the fileuploadFileName
		 */
		public String getFileuploadFileName() {
			return fileuploadFileName;
		}

		/**
		 * @param fileuploadFileName the fileuploadFileName to set
		 */
		public void setFileuploadFileName(String fileuploadFileName) {
			this.fileuploadFileName = fileuploadFileName;
		}

		/**
		 * @return the page
		 */
		public int getPage() {
			return page;
		}

		/**
		 * @param page the page to set
		 */
		public void setPage(int page) {
			this.page = page;
		}

		/**
		 * @return the rows
		 */
		public int getRows() {
			return rows;
		}

		/**
		 * @param rows the rows to set
		 */
		public void setRows(int rows) {
			this.rows = rows;
		}

		/**
		 * @return the elist
		 */
		public Excel_list getElist() {
			return elist;
		}

		/**
		 * @param elist the elist to set
		 */
		public void setElist(Excel_list elist) {
			this.elist = elist;
		}

		public void checkcgsNameCf() {
			boolean bl = sbzjCgsjhServer.checkcgsNameCf(cgsjhlr);
			ResponseUtils.write(getresponse(), bl + "");
		}
		
		public void insertSbzjCgsjhlr(){
			System.out.println("进入方法");
			System.out.println(cgsjhlr);
			String fileType=fileuploadFileName.substring(fileuploadFileName.lastIndexOf(".")+1, fileuploadFileName.length());
			HttpServletResponse response = getresponse();
			
				try {
					if(!"xls".equals(fileType)&&!"xlsx".equals(fileType)){
						response.getWriter().print(fileuploadFileName+"不是系统导出的excel模版文件");
						return ;
					}
					boolean isExcel2003 = true;
					if (fileuploadFileName.matches("^.+\\.(?i)(xlsx)$")) {
					    isExcel2003 = false;
					}
					response.setCharacterEncoding("utf-8"); 
					FileInputStream fs = new FileInputStream(this.fileupload);
					List<Map>[] dataMapArray;
					//System.out.println("isExcel2003============="+isExcel2003);
					    if (isExcel2003)
					        dataMapArray = ExcelReaderUtils.readExcelContent(0, 24, fs, Object.class);
					    else
					        dataMapArray = ExcelReaderUtils.readExcelContent2(0, 24, fs, Object.class);
						//dataMapArray = ExcelReader.readExcelContent(0,20,fs,Object.class);
					//System.out.println(dataMapArray[0]);
					List<Map> data = ExcelReader.removeBlankRow(dataMapArray[0]);
					List<Map> bt =new ArrayList<Map>();
					List<Map> gdxm =new ArrayList<Map>();
					List<Map> ncglxm =new ArrayList<Map>();
					List<Map> nr =new ArrayList<Map>();
					List<Map> list =new ArrayList<Map>();
					if(data.size()>=1) {
					    for (Map d :
					        data) {
					    if (!d.get("0").equals("") && d.get("0") != null && d.get("0").toString().replaceAll("\\s*", "").contains("计划录入")) {
					        bt.add(d);
					    }//设区市	新建	改建	路面改造	养护大中修	灾毁恢复	危桥改造	安防工程	灾害防治	养护工程	示范路
					    if ("设区市".equals(d.get("0").toString().replaceAll("\\s*", ""))&& "新建".equals(d.get("1").toString().replaceAll("\\s*", "")) &&
								"改建".equals(d.get("2").toString().replaceAll("\\s*", "")) &&  "路面改造".equals(d.get("3").toString().replaceAll("\\s*", "")) &&
								"灾毁恢复".equals(d.get("5").toString().replaceAll("\\s*", "")) &&  "安防工程".equals(d.get("7").toString().replaceAll("\\s*", "")) &&
								"养护工程".equals(d.get("9").toString().replaceAll("\\s*", "")) &&  "服务区".equals(d.get("11").toString().replaceAll("\\s*", "")) &&
								"道班".equals(d.get("13").toString().replaceAll("\\s*", "")) &&  "平交道口".equals(d.get("15").toString().replaceAll("\\s*", "")) &&
								"连续长陡下坡".equals(d.get("17").toString().replaceAll("\\s*", ""))&& "隧道提质升级".equals(d.get("19").toString().replaceAll("\\s*", "")) &&
								"养护建设项目".equals(d.get("22").toString().replaceAll("\\s*", ""))) {
					        gdxm.add(d);
					    }
						if ("设区市".equals(d.get("0").toString().replaceAll("\\s*", ""))&& "危桥改造".equals(d.get("1").toString().replaceAll("\\s*", "")) &&
								"安防工程".equals(d.get("2").toString().replaceAll("\\s*", "")) &&  "农村公路建设".equals(d.get("3").toString().replaceAll("\\s*", "")) &&
								"通自然村".equals(d.get("5").toString().replaceAll("\\s*", "")) &&  "民族村".equals(d.get("7").toString().replaceAll("\\s*", "")) &&
								"组组通水泥路".equals(d.get("9").toString().replaceAll("\\s*", "")) &&  "民族村县道升级改造".equals(d.get("11").toString().replaceAll("\\s*", "")) &&
								"养护建设项目".equals(d.get("13").toString().replaceAll("\\s*", ""))) {
								ncglxm.add(d);
							}
					    if (!d.get("0").toString().replaceAll("\\s*", "").contains("计划录入") &&
								!"设区市".equals(d.get("0").toString().replaceAll("\\s*", ""))){
					    	nr.add(d);
					        }
					}
		            System.out.println("bt=========="+bt);
		            System.out.println("gdxm=========="+gdxm);
		            System.out.println("ncglxm=========="+ncglxm);
		            System.out.println("nr=========="+nr);
//		            System.out.println("bt"+bt.size()+bt.get(0).get("0").toString().replaceAll("\\s*", ""));
//		            System.out.println("xm"+xm.size()+xm.get(0).get("0").toString().replaceAll("\\s*", "")+
//		            		xm.get(0).get("0").toString().replaceAll("\\s*", "")+xm.get(0).get("3").toString().replaceAll("\\s*", "")+
//            		xm.get(0).get("7").toString().replaceAll("\\s*", ""));

					String xmdjserach = cgsjhlr.getXmdj();
					if ("国省道".equals(xmdjserach)){
						if (!"国省道资金计划录入".equals(bt.get(0).get("0").toString().replaceAll("\\s*", ""))){
							ResponseUtils.write(getresponse(), "表头不是国省道资金计划录入");
							//response.getWriter().print(fileuploadFileName+"标题不正确");
							return;
						}else {
							if (gdxm.size() > 0 && "设区市".equals(gdxm.get(0).get("0").toString().replaceAll("\\s*", ""))&&
									"路面改造".equals(gdxm.get(0).get("3").toString().replaceAll("\\s*", ""))&&
									"安防工程".equals(gdxm.get(0).get("7").toString().replaceAll("\\s*", ""))) {
								//处理数据
								for (int i = 0; i < nr.size(); i++) {
									//Map<String, String> cgsjhlrMapmx1 = new HashMap<String, String>();
									//项目类型  new2>new1?30:0
									for(int j = 1; j < 23; j++) {
										Map<String, String> cgsjhlrMapmx = new HashMap<String, String>();
										//!nr.get(i).get(j).toString().replaceAll("\\s*", "").isEmpty()&&nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", "").matches("^[-\\\\\\\\+]?([0-9]+\\\\\\\\.?)?[0-9]+$")
										if (!nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", "").isEmpty()) {
											String replaceAll = nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", "");
											//System.out.println("原始数据"+replaceAll);
											boolean matches = replaceAll.matches("^[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*$");
											//System.out.println("正则表达式之后"+matches);
											if(matches) {
												cgsjhlrMapmx.put("xmlx", gdxm.get(0).get(String.valueOf(j)).toString().replaceAll("\\s*", ""));
												String uuid = UUID.randomUUID().toString().replaceAll("-", "");
												cgsjhlrMapmx.put("id", uuid);
												cgsjhlrMapmx.put("jhid", cgsjhlr.getId());
												cgsjhlrMapmx.put("sqrq", cgsjhlr.getSqrq());
												cgsjhlrMapmx.put("bcje", nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", ""));
												cgsjhlrMapmx.put("zhjhje",nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", ""));
												cgsjhlrMapmx.put("bz", cgsjhlr.getBz());
												String xmdj = cgsjhlr.getXmdj();
												String xmlx = nr.get(i).get("0").toString().replaceAll("\\s*", "");
												//System.out.println(nr.get(i).get("0").toString().replaceAll("\\s*", "").contains("鹰潭"));
												boolean contains = nr.get(i).get("0").toString().replaceAll("\\s*", "").contains("鹰潭");
												if (contains) {
													Bkzh autocgshmNcgl = sbzjCgsjhServer.autocgshmNcgl(xmlx);
													if(autocgshmNcgl.getId().toString()!=null) {
														//数据库查询sbzj_bkzh中得id//select * from SBZJ_BKZH where  dwmc like '吉安市'||'%'||'公路'||'%';
														cgsjhlrMapmx.put("zhid", autocgshmNcgl.getId());
													}else {
														response.getWriter().print(fileuploadFileName+"xmdj不能未空");
													}

												}else {
//													if ("农村公路".equals(xmdj)) {
//														Bkzh autocgshmNcgl = sbzjCgsjhServer.autocgshmNcgl(xmlx);
//														if(!autocgshmNcgl.getId().isEmpty()) {
//															//数据库查询sbzj_bkzh中得id//select * from SBZJ_BKZH where  dwmc like '吉安市'||'%'||'公路'||'%';
//															cgsjhlrMapmx.put("zhid", autocgshmNcgl.getId());
//														}else {
//															response.getWriter().print(fileuploadFileName+"xmdj不能未空");
//														}
//
//													}
													if ("国省道".equals(xmdj)) {
														Bkzh autocgshmGsd = sbzjCgsjhServer.autocgshmGsd(xmlx);
														//System.out.println("autocgshmGsd.getId().isEmpty()"+autocgshmGsd.getId());
														//System.out.println("autocgshmGsd.getId().isEmpty()"+autocgshmGsd.getId().isEmpty());
														if(!autocgshmGsd.getId().isEmpty()) {
															//System.out.println("autocgshmGsd.getId().isEmpty()00000"+autocgshmGsd.getId());
															//数据库查询sbzj_bkzh中得id//select * from SBZJ_BKZH where  dwmc like '吉安市'||'%'||'公路'||'%';
															cgsjhlrMapmx.put("zhid", autocgshmGsd.getId());
														}else {
															ResponseUtils.write(getresponse(), "项目等级不能为空");
															//response.getWriter().print(fileuploadFileName+"xmdj不能未空");
														}

													}
												}
											}else {
												ResponseUtils.write(getresponse(), "填写内容不是数字格式");
												return;
											}
											list.add(cgsjhlrMapmx);
										}
									}
//
								}
							}else {
								ResponseUtils.write(getresponse(), "execl标题不正确");
								//response.getWriter().print(fileuploadFileName+"标题不正确");
								return;
							}
						}
					}
					if ("农村公路".equals(xmdjserach)){
						if (!"农村公路资金计划录入".equals(bt.get(0).get("0").toString().replaceAll("\\s*", ""))){
							ResponseUtils.write(getresponse(), "表头不是农村公路资金计划录入");
							//response.getWriter().print(fileuploadFileName+"标题不正确");
							return;
						}else {
							//设区市	危桥改造	安防工程	农村公路建设	养护工程	通自然村	psl贷款	民族村	旅游公路	组组通水泥路	民族村通自然村公路
							// 民族村县道升级改造	美丽生态文明农村路	养护建设项目
							if (ncglxm.size() > 0 && "设区市".equals(ncglxm.get(0).get("0").toString().replaceAll("\\s*", ""))&&
									"农村公路建设".equals(ncglxm.get(0).get("3").toString().replaceAll("\\s*", ""))&&
									"民族村".equals(ncglxm.get(0).get("7").toString().replaceAll("\\s*", "")) &&
									"美丽生态文明农村路".equals(ncglxm.get(0).get("12").toString().replaceAll("\\s*", "")) ) {
								//处理数据
								for (int i = 0; i < nr.size(); i++) {
									//Map<String, String> cgsjhlrMapmx1 = new HashMap<String, String>();
									//项目类型  new2>new1?30:0
									for(int j = 1; j <= 13; j++) {
										Map<String, String> cgsjhlrMapmx = new HashMap<String, String>();
										//!nr.get(i).get(j).toString().replaceAll("\\s*", "").isEmpty()&&nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", "").matches("^[-\\\\\\\\+]?([0-9]+\\\\\\\\.?)?[0-9]+$")
										if (!nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", "").isEmpty()) {
											String replaceAll = nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", "");
											//System.out.println("原始数据"+replaceAll);
											boolean matches = replaceAll.matches("^[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*$");
											//System.out.println("正则表达式之后"+matches);
											if(matches) {
												cgsjhlrMapmx.put("xmlx", ncglxm.get(0).get(String.valueOf(j)).toString().replaceAll("\\s*", ""));
												String uuid = UUID.randomUUID().toString().replaceAll("-", "");
												cgsjhlrMapmx.put("id", uuid);
												cgsjhlrMapmx.put("jhid", cgsjhlr.getId());
												cgsjhlrMapmx.put("sqrq", cgsjhlr.getSqrq());
												cgsjhlrMapmx.put("bcje", nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", ""));
												cgsjhlrMapmx.put("zhjhje",nr.get(i).get(String.valueOf(j)).toString().replaceAll("\\s*", ""));
												cgsjhlrMapmx.put("bz", cgsjhlr.getBz());
												String xmdj = cgsjhlr.getXmdj();
												String xmlx = nr.get(i).get("0").toString().replaceAll("\\s*", "");
												//System.out.println(nr.get(i).get("0").toString().replaceAll("\\s*", "").contains("鹰潭"));
												boolean contains = nr.get(i).get("0").toString().replaceAll("\\s*", "").contains("鹰潭");
												if (contains) {
													Bkzh autocgshmNcgl = sbzjCgsjhServer.autocgshmNcgl(xmlx);
													if(autocgshmNcgl.getId().toString()!=null) {
														//数据库查询sbzj_bkzh中得id//select * from SBZJ_BKZH where  dwmc like '吉安市'||'%'||'公路'||'%';
														cgsjhlrMapmx.put("zhid", autocgshmNcgl.getId());
													}else {
														response.getWriter().print(fileuploadFileName+"xmdj不能未空");
													}

												}else {
													if ("农村公路".equals(xmdj)) {
														Bkzh autocgshmNcgl = sbzjCgsjhServer.autocgshmNcgl(xmlx);
														if(!autocgshmNcgl.getId().isEmpty()) {
															//数据库查询sbzj_bkzh中得id//select * from SBZJ_BKZH where  dwmc like '吉安市'||'%'||'公路'||'%';
															cgsjhlrMapmx.put("zhid", autocgshmNcgl.getId());
														}else {
															response.getWriter().print(fileuploadFileName+"xmdj不能未空");
														}

													}
//													if ("国省道".equals(xmdj)) {
//														Bkzh autocgshmGsd = sbzjCgsjhServer.autocgshmGsd(xmlx);
//														//System.out.println("autocgshmGsd.getId().isEmpty()"+autocgshmGsd.getId());
//														//System.out.println("autocgshmGsd.getId().isEmpty()"+autocgshmGsd.getId().isEmpty());
//														if(!autocgshmGsd.getId().isEmpty()) {
//															//System.out.println("autocgshmGsd.getId().isEmpty()00000"+autocgshmGsd.getId());
//															//数据库查询sbzj_bkzh中得id//select * from SBZJ_BKZH where  dwmc like '吉安市'||'%'||'公路'||'%';
//															cgsjhlrMapmx.put("zhid", autocgshmGsd.getId());
//														}else {
//															ResponseUtils.write(getresponse(), "项目等级不能为空");
//															//response.getWriter().print(fileuploadFileName+"xmdj不能未空");
//														}
//
//													}
												}
											}else {
												ResponseUtils.write(getresponse(), "填写内容不是数字格式");
												return;
											}
											list.add(cgsjhlrMapmx);
										}
									}
								}
							}else {
								ResponseUtils.write(getresponse(), "execl标题不正确");
								//response.getWriter().print(fileuploadFileName+"标题不正确");
								return;
							}
						}
					}
//						if (bt.size() > 0 ) {
//
//						}else {
//					    	ResponseUtils.write(getresponse(), "execl表头不是计划录入");
//					    	//response.getWriter().print(fileuploadFileName+"表头不是计划录入");
//							return;
//						}
					        
					}else {
						ResponseUtils.write(getresponse(), "execl表内容为空");
						//response.getWriter().print(fileuploadFileName+"数据为空");
						return;
					}
					System.out.println("listss-------------"+"list-------------"+list.size()+list);
					double total = 0;
					for (int k = 0; k < list.size(); k++) {
						total+=Double.parseDouble(String.valueOf(list.get(k).get("bcje")));
					}
					double totaljhje= Double.parseDouble(cgsjhlr.getJhje());
					System.out.println(total+"+++++++"+totaljhje);
					System.out.println(total==totaljhje);
					if (total!=totaljhje) {
						ResponseUtils.write(getresponse(), "记划录入总金额不等于计划金额");
						return;
					}
					System.out.println("list-------------"+"list-------------"+list.size()+list);
					//将数据插入到数据库
					boolean b=sbzjCgsjhServer.insertSbzjCgsjhlr(cgsjhlr,list);
					if(b)
						ResponseUtils.write(getresponse(), b + "");
					else 
						ResponseUtils.write(getresponse(), "");
						//response.getWriter().print(fileuploadFileName+"导入失败");
				} catch (FileNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			
			
		   }

		public void autoCgsxmmc() throws Exception { 
			//System.out.println("插入数据是1=========="+cgsjhlr);
			List<Cgsjhlr> l=new	 ArrayList<Cgsjhlr>(); 
			l=sbzjCgsjhServer.autoCgsxmmc(cgsjhlr.getXmmc().trim());
		 
		 if(l.size()==0) { 
		// Xmjbxx x=new Xmjbxx(); 
		// x.setXmmc(xmjbxx.getXmmc());
	    // l.add(x); 
		 Cgsjhlr cgsjhlrA = new Cgsjhlr();
		 cgsjhlrA.setXmmc(cgsjhlrA.getXmmc()); 
		 l.add(cgsjhlrA); 
		 }
		 JsonUtils.write(l,	getresponse().getWriter()); 
		 }
		
		public void selectsbzjCgsList() {
			cgsjhlr.setPage(page);
			cgsjhlr.setRows(rows);
			cgsjhlr.setXmnf(MyUtil.getQueryTJ(cgsjhlr.getXmnf(), "xmnf"));

			List<Cgsjhlr> list = sbzjCgsjhServer.selectsbzjCgsList(cgsjhlr);
			int count = sbzjCgsjhServer.selectsbzjCgsListCount(cgsjhlr);
			EasyUIPage<Cgsjhlr> e = new EasyUIPage<Cgsjhlr>();
			e.setRows(list);
			e.setTotal(count);
			try {
				JsonUtils.write(e, getresponse().getWriter());
			} catch (Exception e1) {
				e1.printStackTrace();
			}
		}	
	    //项目详细信息查询	
		public void queryCgslist() {
			if (cgsjhlrMx.getPage() == 0) {
				cgsjhlrMx.setPage(page);
			}
			if (cgsjhlrMx.getRows() == 0) {
				cgsjhlrMx.setRows(rows);
			}
			List<CgsjhlrMx> list = sbzjCgsjhServer.queryCgslist(cgsjhlrMx);
			int count = sbzjCgsjhServer.queryCgslistCount(cgsjhlrMx);
			EasyUIPage<CgsjhlrMx> e = new EasyUIPage<CgsjhlrMx>();
			e.setRows(list);
			e.setTotal(count);
			try {
				JsonUtils.write(e, getresponse().getWriter());
			} catch (Exception e1) {
				e1.printStackTrace();
			}
		}
		//删除项目（包含所属子项目）
		public void delCgsjhlr() {
			boolean bl = sbzjCgsjhServer.delCgsjhlr(cgsjhlr);
			ResponseUtils.write(getresponse(), bl + "");
		}
		//删除项目明细（单独）
		public void delCgsjhlrMx() {
			boolean bl = sbzjCgsjhServer.delCgsjhlrMx(cgsjhlrMx);
			ResponseUtils.write(getresponse(), bl + "");
		}	
			
		//
		public void sumyeBycgsBJID() {
			try {
				System.out.println(cgsjhlrMx);
				CgsjhlrMx bl = sbzjCgsjhServer.selectsumyeByBJID(cgsjhlrMx);
				System.out.println(bl);
				JsonUtils.write(bl, getresponse().getWriter());
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		} 
		
		public void updateSbzjcgsjhlr() {
			boolean bl = sbzjCgsjhServer.updateSbzjcgsjhlr(cgsjhlr);
			ResponseUtils.write(getresponse(), bl + "");
		}

		public void updateSbzjcgsjhlrMx() {
		System.out.println("进入修改方法"+cgsjhlrMx);
		boolean bl = sbzjCgsjhServer.updateSbzjcgsjhlrMx(cgsjhlrMx);
		ResponseUtils.write(getresponse(), bl + "");
	}

		public void sumyecgs(){
			try {
				Cgsjhlr bl = sbzjCgsjhServer.selectsumyecgs(cgsjhlr);
				JsonUtils.write(bl, getresponse().getWriter());
			} catch (Exception e) {
				e.printStackTrace();
			}
		}


	
	
	
	
	
	
	
	
	
	

	@Override
	public Excel_list getModel() {
		// TODO Auto-generated method stub
		return null;
	}
	

}
